package com.pig4cloud.pig.pigunit.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pig.pigunit.entity.Unit;
import com.pig4cloud.pig.pigunit.mapper.UnitMapper;
import com.pig4cloud.pig.pigunit.service.UnitService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

@AllArgsConstructor
@Service
public class UnitServiceImpl extends ServiceImpl<UnitMapper, Unit> implements UnitService {

	private UnitMapper unitMapper;
	@Override
	public Unit getByBuildingIdAndUnitName(Unit unit) {
		return unitMapper.getByBuildingIdAndUnitName(unit);
	}

	@Override
	public Page<Unit> selectAll(Page<Unit> page, String unitName) {
		return unitMapper.selectAll(page, unitName);
	}

	@Override
	public void deleteById(Long[] ids) {
		unitMapper.deleteByIds(ids);
	}
}
